layui.jquery.ajax=M.ajax;


app.get("/dictionaryList",async (req,res)=>{
    let result=await M.request.get("/crmhelp/dictionary/list",{
        parent_id:req.params.parent_id
    })
    res.send(result)
})


app.get("/dictionaryAdd",async (req,res)=>{
    let result={}
    if(req.params.id){
        result=await M.request.post("/crmhelp/dictionary/update",req.params)
    }else {
        result=await M.request.post("/crmhelp/dictionary/add",req.params)
    }
    res.send(result)
})

app.get("/dictionaryDelete",async (req,res)=>{
    let r= await M.request.post("/crmhelp/dictionary/delete",{
        "idList": req.params.idList
    });
    res.send(r)
})


app.get("/dictionarySync",async (req,res)=>{
    let r= await M.request.get("/crmhelp/dictionary/sync",{
        "id": req.params.id
    });
    res.send(r)
})















